{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
{echo:JS::import('date');}
<style type="text/css">
    #table_option td{
        width: 8px;
        height: 8px;
        background: #ddd;
        border:1px #999 solid;
        cursor: pointer;
    }
</style>
<h1 class="page_title">{$title}</h1>
<form action="{url:/app/first_slide_save}" method="post" id="appForm" enctype="multipart/form-data">
<div id="obj_form" class="form2">

		<dl class="lineD">
        <dt>轮播位置：</dt>
        <dd>
        	{set:$arr=array('商城首页','品牌商城','积分商城')}
        	{if:!empty($obj)}
        	<select name="sel_type" disabled>
        		{list:items=$arr key=$i}
        			{if:$obj['type']==$i}
        				<option value='{$i}' selected="selected">{$arr[$i]}</option>
        			{/if}
        		{/list}
        	</select>
        	{else:}
       		<select name="sel_type">
       			{list:items=$arr key=$i}
        			<option value='{$i}'>{$arr[$i]}</option>
        		{/list}
        		
       		</select>
          	{/if}
        </dd>
        </dl>
        <dl class="lineD">
        <dt>图片：</dt>
        <dd>
        	{if:$obj['id'] == null}
        		<input type="file" name="upImg" id="upImg" class="big"/>  
        	{else:}
        		<img src="{$domain}{$obj['content']}" width="400" height="auto"/>
        	{/if}
          	        
        </dd>
        </dl>
        {if:$obj['id'] != null}
        <dl class="lineD">
        <dt> 替换图片：</dt>
        <dd>
          <input type="file" name="upsImg" id="upsImg"/>
        </dd>
        </dl>
        {/if}
      </div>
      <input type="hidden" name="id" value="{$obj['id']}"/>
      <!--活动描述 end-->
      <div style="text-align:center"><input onclick="return check();" type="submit" value="提交" class="button">
      	&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" class="button"></div>
</form>
<script type="text/javascript">

function goods_select(gid)
{
  art.dialog.open('{url:/app/radio_news_select?gid='+gid+'}',{id:'goods_select',title:'选择新闻：',width:900,height:500,padding:'10px'});
}
/*
function news_select(gid)
{
  art.dialog.open('{url:/app/radio_news_select?gid='+gid+'}',{id:'news_select',title:'选择新闻：',width:900,height:500,padding:'10px'});
}
*/
function check()
{
	
	if($("#upImg").val() == "")
	{
		$(".invalid-msg").remove();
		//alert("图片不能为空");
		$("#upImg").after("<label class='invalid-msg'>图片不能为空</label>");
		return false;
	}
	else
	{
		$("#upImg").next().remove();
	}
}
$("#table_option td:eq({$contents[0]['position']})").css("background","#000");
</script>